/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package easyanimation.panel;

import easyanimation.frame.CConfig;
import easyanimation.frame.Constant;
import easyanimation.frame.Language;
import java.awt.event.ActionEvent;
import java.util.Vector;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JToolBar;

/**
 *
 * @author Ngoc Tan
 */
public class CToolbarPanel extends JToolBar
{
    private JButton m_zoomOutButton;
    private JButton m_zoomInButton;
    private JButton m_cutButton;
    private JButton m_newFileButton;
    private JButton m_redoButton;
    private JButton m_undoButton;
    private JButton m_saveButton;
    private JButton m_backButton;
    public CToolbarPanel()
    {
        //set base attributes
        setSize(Constant.WINDOW_WIDTH, Constant.WINDOW_HEIGHT_HEADER);
        setBorder(Constant.OBJ_BORDER_TOOBAR);
        
        //addSeparator();        
        m_newFileButton = new JButton(new ImageIcon("res/new_file.png"));
        m_newFileButton.setMargin(Constant.OBJ_MARGIN);
        m_newFileButton.setToolTipText(Language.TOOLTIP_NEW_FILE[CConfig.LANGUAGE]);
        add(m_newFileButton);
        
        m_saveButton = new JButton(new ImageIcon("res/save.png"));
        m_saveButton.setMargin(Constant.OBJ_MARGIN);
        m_saveButton.setToolTipText(Language.TOOLTIP_SAVE[CConfig.LANGUAGE]);
        add(m_saveButton);
        
        m_backButton = new JButton(new ImageIcon("res/back.png"));
        m_backButton.setMargin(Constant.OBJ_MARGIN);
        m_backButton.setToolTipText(Language.TOOLTIP_BACK[CConfig.LANGUAGE]);
        add(m_backButton);
        
        m_cutButton = new JButton(new ImageIcon("res/cut.png"));
        m_cutButton.setMargin(Constant.OBJ_MARGIN);
        m_cutButton.setToolTipText(Language.TOOLTIP_CUT[CConfig.LANGUAGE]);
        add(m_cutButton);
        
        m_redoButton = new JButton(new ImageIcon("res/redo.png"));
        m_redoButton.setMargin(Constant.OBJ_MARGIN);
        m_redoButton.setToolTipText(Language.TOOLTIP_REDO[CConfig.LANGUAGE]);
        add(m_redoButton);
        
        m_undoButton = new JButton(new ImageIcon("res/undo.png"));
        m_undoButton.setMargin(Constant.OBJ_MARGIN);
        m_undoButton.setToolTipText(Language.TOOLTIP_UNDO[CConfig.LANGUAGE]);
        add(m_undoButton);
        
        m_zoomInButton = new JButton(new ImageIcon("res/zoom_in.png"));
        m_zoomInButton.setMargin(Constant.OBJ_MARGIN);
        m_zoomInButton.setToolTipText(Language.TOOLTIP_ZOOM_IN[CConfig.LANGUAGE]);
        add(m_zoomInButton);
        
        m_zoomOutButton = new JButton(new ImageIcon("res/zoom_out.png"));
        m_zoomOutButton.setMargin(Constant.OBJ_MARGIN);
        m_zoomOutButton.setToolTipText(Language.TOOLTIP_ZOOM_OUT[CConfig.LANGUAGE]);
        add(m_zoomOutButton);
        
        
//        add(new TempAction());
    }

    class TempAction extends AbstractAction
    {

        public TempAction()
        {
            putValue(AbstractAction.SHORT_DESCRIPTION, "Exit");
        }

        @Override
        public void actionPerformed(ActionEvent e)
        {
            throw new UnsupportedOperationException("Not supported yet.");
        }
        
    }
}

